package com.itheima.exce;

import java.util.Scanner;

public class ExceptionDemo2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的年龄");
        String line = sc.nextLine();
        try {
            int age = Integer.parseInt(line);
            System.out.println(age);
            System.out.println(2 / 0);
        } catch (NumberFormatException e) {
            System.out.println("看看执行了吗？");
        } catch (ArithmeticException e) {
            System.out.println("除数不能为0");
        } catch (Exception e) {
            System.out.println("还是有异常情况出现");
        }
        System.out.println("测试456");
    }
}

